/**
 * @Author: 九璃怀特 1599130621@qq.com
 * @Date: 2022-10-20 10:12:53
 * @LastEditors: 九璃怀特 1599130621@qq.com
 * @LastEditTime: 2022-10-21 10:11:13
 * @FilePath: \nonogram\vite.config.ts
 * @Description: 
 */

import vue from "@vitejs/plugin-vue";
// const { resolve } = require("path");
import * as path from 'path'
import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
  base:'./',
  server:{
    host:'0.0.0.0',
    port:8889,
    https:false,
    proxy:{
      './api':{
        target:'http://124.222.212.134:8888',
        changeOrigin:true,
        cookiePathRewrite:{
          '^/api':''
        },
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
});
